<template>
  <div class="wdsc" >
 
             <van-nav-bar
  title="我的收藏"
  left-text="返回"
  right-text="..."
  left-arrow
  @click-left="$router.go(-1)"
 
/>
  
    <div class="goods">
      <div class="good-box" v-for="(item,index) in list" :key="index" @click="$router.push({path:'/detail',query:{id:item.mtWmPoiId} })">
        <div class="img-box">
          <img :src="item.picUrl" alt="" />
        </div>
        <div class="text">
          <p>{{ item.shopName }}</p>
          <div class="ys">
            <p>
              <span>⭐4.5</span><span>月售{{ item.monthSalesTip }}</span>
            </p>
            <p>商家配送</p>
          </div>
          <div class="jg">
            <p>起送￥{{ item.Price }} 配送{{ item.shopingFeeTip }}</p>
            <p>53分钟 28KM</p>
          </div>
          <div class="yh">
            <span>津贴1元</span>
            <span>7元会员红包</span>
            <span>品质联盟</span>
            <span>5折</span>
          </div>
        </div>
      </div>
    <div class="db">
      <span>已加载全部商品</span>
    </div>
    </div>

    
  </div>
</template>

<script>
import { shopcart_sclb } from "../utils/api";
export default {
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    var userinfo = localStorage.getItem("userinfo")
      ? JSON.parse(localStorage.getItem("userinfo"))
      : {};
  
    if (userinfo.id) {
     shopcart_sclb({ userid: userinfo.id }).then((res) => {
        console.log(userinfo.id);
        this.list = res.data.list;
        console.log( res.data);
      });
    }
  },
};
</script>

<style lang='scss' scoped>
.nav{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: #eee;
}
.wdsc {
  .goods {
    display: flex;
    flex-direction: column;
  }

  padding: 10px;
  > p {
    font-size: 20px;
    font-weight: 700;
    span {
      color: aqua;
    }
  }
  .good-box {
    margin: 20px 0;
    height: 100px;
    display: flex;
    .img-box {
      img {
        width: 80px;
        height: 80px;
      }
    }
    .text {
      > p {
        font-weight: 700;
      }
      .ys {
        display: flex;
        justify-content: space-between;
        p {
          color: #ccc;
          font-size: 14px;
          span:nth-child(1) {
            color: red;
          }
        }
      }
      .jg {
        display: flex;
        justify-content: space-between;
        p {
          color: #ccc;
          font-size: 14px;
        }
      }
      .yh {
        span {
          font-size: 12px;
          padding: 52x;
          border: 1px solid red;
          margin: 0 5px;
          color: red;
        }
        span:nth-child(2) {
          border: 1px solid orange;
          color: orange;
        }
      }
    }
  }
  .db {
    text-align: center;
    span {
      color: #ccc;
    }
  }
}
</style>